<!-- html -->
<template>
    <h1 class="h1">全局API</h1>
    <span class="span1" @click="globalComponentTest1">全局组件</span>
    <span class="span1" @click="globalConfigTest1">全局属性</span>
    <span class="span1" @click="globalDirectiveTest1">全局指令</span>
    <hr>
    <RouterView />
</template>

<!-- js或ts -->
<script lang="ts">
export default {
    //组件名
    name: 'globalApiHome'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { useRouter } from 'vue-router'
//数据
let router = useRouter()
//方法
function globalComponentTest1() {
    router.push({
        path: '/globalApiHome/globalComponentTest1'
    })
}
function globalConfigTest1() {
    router.push({
        path: '/globalApiHome/globalConfigTest1'
    })
}
function globalDirectiveTest1() {
    router.push({
        path: '/globalApiHome/globalDirectiveTest1'
    })
}
</script>

<!-- 样式 -->
<style scoped></style>